POV-Ray : Newsgroups : povray.general : Pinching points : Pinching points Server Time
10 Aug 2024 17:29:47 EDT (-0400)
  Pinching points  
From: Alf Peake
Date: 23 Nov 1999 18:21:10
Message: <383b2166@news.povray.org>
Given a loop that goes from 0 to 1, in say, 20 equal steps,
how would I use these figures to give me the same range but
in non-linear steps that "pinch" or tend to bunch together at
around 0.75?

I feel a sine function is involved but the best I have managed
is shown here which I'm not satisfied with. It shows linear Red
points converted to nonlinear Blue points.

Alf

http://www.peake42.freeserve.co.uk
http://ourworld.compuserve.com/homepages/Alf_Peake/

// Start of file
camera{ location <0.5,0,-3> angle 22 look_at x*0.5 }
light_source { -100*z rgb 1 }
plane{ -z,0 pigment{ checker 0.2, 0.5 } scale 0.1 }
cylinder{ 0, x, 0.005 pigment{ rgb <1,1,0> } } // Show range
#declare Point=1;
#while (Point>0.04)
sphere{ <Point, 0.05, 0>, 0.01 pigment{ red 1 } }

// Any suggestions here please?
#declare Try = pow( sin( Point*2 ), 2 ) - 0.17;
sphere{ <max( Point, Try ), 0, 0>, 0.01 pigment{ blue 1 } }

#declare Point=Point-0.05;
#end
file://eof


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.